<?php
    // 查询 cv 表
    function get_cv_data(){
        $result = mysql_query("SELECT * FROM cv");
  
        $results = array();
        while ($row = mysql_fetch_assoc($result)) {
            $results[] = $row;
        }
    
        $arrData = createJsonData($results);
        
        echo json_encode($arrData);
    }


    function get_cv_data_by_openid(){
        $result = mysql_query("SELECT * FROM cv where openid = '$_POST[openid]'");
  
        $results = array();
        while ($row = mysql_fetch_assoc($result)) {
            $results[] = $row;
        }
    
        $arrData = createJsonData($results);
        
        echo json_encode($arrData);
    }

    // 添加 cv 数据
    function insert_cv_data(){
        $cv_id = time() * 3;
        mysql_query("insert into cv 
        (cv_id , name , tel , job_position , company , 
        job_age , introduction , openid)  
        values 
        ('$cv_id' , '$_POST[name]' , '$_POST[tel]' , 
        '$_POST[job_position]' , '$_POST[company]' , 
        '$_POST[job_age]' , '$_POST[introduction]' , '$_POST[openid]')");
        
    }

    // 删除 chanpin 数据
    function delete_cv_data(){
        mysql_query("delete from cv_id where Id='$_GET[cv_id]'");
    }



?>